package com.ccc.demoboot.controller;

import com.ccc.demoboot.common.R;
import com.ccc.demoboot.pojo.Jobtype;
import com.ccc.demoboot.service.JobtypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author wz
 * @Date 2024/7/10 8:36
 * @PackageName:com.ccc.demoboot.controller
 * @ClassName: JobtypeController
 */
@RequestMapping("/jobtype")
@RestController
public class JobtypeController {

    @Autowired
    JobtypeService jobtypeService;

    /**
     * 查询所有工种信息
     * @return
     */
    @PostMapping("/select")
    public R select(){
        List<Jobtype> list = this.jobtypeService.list();
        return new R().add("list",list);
    }


    /**
     * 根据岗位id查询工种信息
     * @return
     */
    @PostMapping("/postselect")
    public R postSelect(@RequestBody Jobtype jobtype){
       List<Jobtype> list= this.jobtypeService.postSelect(jobtype.getPostid());
        return new R().add("list",list);
    }
}
